/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: jse2302 - Ex7
 * <p>Powered by webrx On 2023-06-13 09:34:49
 * <p>Created by IntelliJ IDEA
 *
 * @author  webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex9 {
    public static void main(String[] args) {
        //1-100所有素数
        ok:
        for (int n = 2; n <= 100; n++) {
            //if (isPrimeNumber(n))
            //System.out.print(n + " ");
            for (int j = 2; j < n; j++)
                if (n % j == 0) continue ok;
            System.out.printf(n + " ");
        }

    }

    /**
     * Description: 判断一个数字是不是素数，是返回true
     *
     * @date: 2023/6/13 9:59
     * @params: [int]
     * @return: boolean
     */
    public static boolean isPrimeNumber(int n) {
        boolean f = true;
        for (int j = 2; j < n; j++) {
            if (n % j == 0) {
                f = false;
                break;
            }
        }
        return f;
    }
}
